import 'package:flutter_huawei_cloud/src/obs_progress.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_huawei_cloud/flutter_huawei_cloud.dart';
import 'package:flutter_huawei_cloud/flutter_huawei_cloud_platform_interface.dart';
import 'package:flutter_huawei_cloud/flutter_huawei_cloud_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterHuaweiCloudPlatform
    with MockPlatformInterfaceMixin
    implements FlutterHuaweiCloudPlatform {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> initialize({
    required String accessKey,
    required String secretKey,
    required String region,
  }) {
    // TODO: implement initialize
    throw UnimplementedError();
  }

  @override
  // TODO: implement onUploadProgress
  Stream<OBSProgress> get onUploadProgress => throw UnimplementedError();

  @override
  Future<String?> uploadFile(
    String bucketName,
    String objectKey,
    String filePath,
  ) {
    // TODO: implement uploadFile
    throw UnimplementedError();
  }

  @override
  Future<Map<String, String>?> uploadMultipleFile(
    String bucketName,
    List<Map<String, String>> files,
  ) {
    // TODO: implement uploadMultipleFile
    throw UnimplementedError();
  }
}

void main() {
  final FlutterHuaweiCloudPlatform initialPlatform =
      FlutterHuaweiCloudPlatform.instance;

  test('$MethodChannelFlutterHuaweiCloud is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterHuaweiCloud>());
  });

  test('getPlatformVersion', () async {
    FlutterHuaweiCloud flutterHuaweiCloudPlugin = FlutterHuaweiCloud();
    MockFlutterHuaweiCloudPlatform fakePlatform =
        MockFlutterHuaweiCloudPlatform();
    FlutterHuaweiCloudPlatform.instance = fakePlatform;

    expect(await flutterHuaweiCloudPlugin.getPlatformVersion(), '42');
  });
}
